package com.hhkj.study.admin.config.service.extend.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hhkj.study.admin.config.entity.ConfigBase;
import com.hhkj.study.admin.config.model.podo.ConfigBaseDo;
import com.hhkj.study.admin.config.model.podo.ConfigBasePo;
import com.hhkj.study.admin.config.service.base.ConfigBaseService;
import com.hhkj.study.admin.config.service.extend.ConfigBaseExtendService;
import com.ruoyi.common.base.biz.service.extend.BaseExtendServiceImpl;
import com.ruoyi.common.cont.SysConst;
import org.springframework.stereotype.Service;

import java.util.List;

/**
*
* @author SERVER
* @since 2024-09-06
*/
@Service
public class ConfigBaseExtendServiceImpl extends BaseExtendServiceImpl<ConfigBase, ConfigBaseDo, ConfigBasePo, ConfigBaseService> implements ConfigBaseExtendService {

    @Override
    public List<ConfigBase> getConfigByCourseType(String code, Long courseType) {
        LambdaQueryWrapper<ConfigBase> configBaseQuery = new LambdaQueryWrapper<>();
        configBaseQuery.eq(ConfigBase::getCode, code).eq(ConfigBase::getDisableFlag, SysConst.Flag.NO.getFlag()).eq(ConfigBase::getCourseType, courseType);
        return this.getService().list(configBaseQuery);
    }
}
